package com.asiainfo_linkage.scheduler;

import java.util.List;
import java.util.TimerTask;
import com.asiainfo_linkage.message.EmailSender;
import com.asiainfo_linkage.message.MessageSender;
import com.asiainfo_linkage.model.AddMember;
import com.asiainfo_linkage.model.RemTask;

/**
 * 通知提醒任务。
 * @author Administrator
 *
 */
public class NotifierTimerTask extends TimerTask{
	
	private RemTask remTask;
	
	private List<AddMember> receivers;
	
	public RemTask getRemTask() {
		return remTask;
	}

	public void setRemTask(RemTask remTask) {
		this.remTask = remTask;
	}

	public List<AddMember> getReceivers() {
		return receivers;
	}

	public void setReceivers(List<AddMember> receivers) {
		this.receivers = receivers;
	}

	public NotifierTimerTask(RemTask remTask, List<AddMember> receivers) {
		super();
		this.remTask = remTask;
		this.receivers = receivers;
	}

	@Override
	public void run() {
		//发送邮件。
		MessageSender sender = new EmailSender();
		sender.send(remTask, receivers);
		System.out.println("邮件已经到达");
	}

}
